package com.yc.bean;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.time.LocalDateTime;

/**
 * 用户实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("user")
public class User {
    
    @TableId(value = "userId", type = IdType.AUTO)
    private Long userId;
    
    @TableField("username")
    private String username;
    
    @TableField("password")
    private String password;
    
    @TableField("email")
    private String email;
    
    @TableField("avatar")
    private String avatar;
    
    @TableField("tags")
    private String tags; // 逗号分隔
    
    @TableField("interests")
    private String interests; // 逗号分隔
    
    @TableField(value = "createdAt", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;
    
    @TableField(value = "updatedAt", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
    
    // 非数据库字段：测评统计信息
    @TableField(exist = false)
    private Integer totalTests; // 总测评次数
    
    @TableField(exist = false)
    private Integer completedTests; // 完成测评次数
    
    @TableField(exist = false)
    private LocalDateTime lastTestTime; // 最后测评时间
}
